/*
 * user_flash_spi_driver.h
 *
 *  Created on: Dec 20, 2023
 *      Author: dk007
 */

#ifndef INCLUDE_USER_FLASH_SPI_DRIVER_H_
#define INCLUDE_USER_FLASH_SPI_DRIVER_H_

#define WIP_Flag 0x01

/************************FLASH Instruction***************************/
#define W25X_WriteEnable              0x06
#define W25X_WriteDisable             0x04
#define W25X_ReadStatusReg            0x05
#define W25X_WriteStatusReg           0x01
#define W25X_ReadData                 0x03
#define W25X_FastReadData             0x0B
#define W25X_FastReadDual             0x3B
#define W25X_PageProgram              0x02
#define W25X_BlockErase               0xD8
#define W25X_SectorErase              0x20
#define W25X_ChipErase                0xC7
#define W25X_PowerDown                0xB9
#define W25X_ReleasePowerDown         0xAB
#define W25X_DeviceID                 0xAB
#define W25X_ManufactDeviceID         0x90
#define W25X_JedecDeviceID            0x9F

#define WIP_Flag                      0x01
#define Dummy_Byte                    0xFF

#if USER_NOR_FLASH_EN
void user_nor_flash_spi_init(void);
void user_nor_flash_spi_uninit(void);
uint32_t SPI_FLASH_ReadID(void);
uint8_t SPI_FLASH_init(void);
#endif

#endif /* INCLUDE_USER_FLASH_SPI_DRIVER_H_ */
